package com.test.springcloudappribbon.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.test.springcloudappribbon.service.HelloService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloControler {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private HelloService helloService;

    @RequestMapping(value = "/hi3")
    @HystrixCommand
    public String hi(@RequestParam String name){
        logger.info("hi is called");
        return helloService.hiService(name);
    }



}
